package com.boco.blch.runner.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class ErrorMessageUtil {
	private static String ERROR_MESSAGE_PREFIX = "ERROR_CODE_";
	private static String PROPERTIES_PATH = "runner/ErrorCode.properties";
	private static Properties pro = new Properties();
	static{
		init();
	}
	public static void init(){
		InputStream is = ErrorMessageUtil.class.getClassLoader().getResourceAsStream(PROPERTIES_PATH);
		try {
			pro.load(is);
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			try {
				is.close();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}
	
	public static String getErrorMessageByErrorCode(int code){
		return pro.getProperty(ERROR_MESSAGE_PREFIX + code);
	}
	
	

}
